package AICore;

import game.GameBoard;

import java.util.LinkedList;
import java.util.Random;

import carddeck.Card;
import carddeck.Rank;
import carddeck.Suit;

public class CPUTestPlayer extends CPUPlayer{
	public CPUTestPlayer(String playerName) {
		super(playerName);
	}
	public void makeAMove(boolean bAfterdraw) {
		LinkedList<LinkedList<Card>> solutions = null;
		if(bAfterdraw)
			solutions = SolutionsFactory.createSolutions(getCards(), GameBoard.getInstance().getCardRevealed(), null);
		else
			solutions = SolutionsFactory.createSolutions(getCards(), null, null);
		LinkedList<Card> bestSolution = null;
		if(solutions.size()>0)
			bestSolution=solutions.get(new Random().nextInt(solutions.size()));
		playCards(bestSolution);
	}
	
	public void makeADemand() {
		demand(null);
	}
	
	public void pickAColor(Card theAce) {
		theAce.setFakeCard(new Card(Suit.intToSuit(new Random().nextInt(4)+1), Rank.ACE));
	}
}
